<?php
/*
 *      tovarlistform.php
 *      
 *      Copyright 2011 Vitaliy Rakitin <virak@ukr.net>
 *      
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *      
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
 
require_once("osform.php");
//require_once("tovar.php");
require_once("dictionary.php");
require_once("fieldedit.php");

class tovarlistform extends osform {
	
	protected $object;
	protected $fieldedit;
	//protected $fieldedit2;
	//protected $fieldedit3;
	
	function __construct($object) {
		$this->object = $object;
		parent::__construct();
	}
	
	function oncreate() {
		//$this->object = new dictionary("Товар");
		$this->body = "";
		foreach($this->object->getallfields() as $field) {
			$this->fieldedit = new fieldedit();
			$this->fieldedit->field = $field;
			$this->body .= $field->name.":".$this->fieldedit->get()."<br>";
		}
/*
		$this->fieldedit1 = new fieldedit();
		$this->fieldedit1->field = $this->object->fieldbyname("Наименование");
		$this->fieldedit2 = new fieldedit();
		$this->fieldedit2->field = $this->object->fieldbyname("ЦенаП");
		$this->fieldedit3 = new fieldedit();
		$this->fieldedit3->field = $this->object->fieldbyname("ЦенаР");
		$this->fieldedit4 = new fieldedit();
		$this->fieldedit4->field = $this->object->fieldbyname("ЦенаР");
		$this->body = $this->fieldedit1->get()."<br>".$this->fieldedit2->get()."<br>".$this->fieldedit3->get()."<br>".$this->fieldedit4->get();
*/
		
/*
		$this->object = new tovar();
		$this->fieldedit1 = new fieldedit();
		$this->fieldedit1->field = $this->object->fieldbyname("name");
		$this->fieldedit2 = new fieldedit();
		$this->fieldedit2->field = $this->object->fieldbyname("priceP");
		$this->fieldedit3 = new fieldedit();
		$this->fieldedit3->field = $this->object->fieldbyname("priceR");
		$this->body = $this->fieldedit1->get().$this->fieldedit2->get().$this->fieldedit3->get();
*/
		//$this->body = "<pre>".print_r($this,1)."</pre>";
	}
	
	//function onshow() {}
}

?>

